﻿using System;
using System.Collections.Generic;
using System.Text;

namespace mozhi.smarterp.Finance.Logs
{
    public class OperationLogSetting : AggregateRootBase<Guid>
    {
        public string Code { private set; get; }

        /// <summary>
        /// 名称（对应的应该是具体的操作对象：如果供应商，客户，凭证等）
        /// </summary>
        public string Name { private set; get; }

        public string Comment { private set; get; }

        public List<OperationSettingItem> Items { private set; get; }

        private OperationLogSetting() { }

        public OperationLogSetting(Guid id , string code, string name , string comment)
        {
            Id = id;
            Code = code;
            Name = name;
            Comment = comment;
            Items = new List<OperationSettingItem>();
        }

        public void ChangeItems(List<OperationSettingItem> items)
        {
            Items = items;
        }
    }

    public class OperationSettingItem : EntityBase<Guid>
    {
        public Guid OperationSettingId { private set; get; }

        public string FieldName { private set; get; }

        public string FieldCaption { private set; get; }

        /// <summary>
        /// 数据类型 1用户Id , 2供应商Id ,3 科目 4 文件 , 5会计准则 6币别
        /// </summary>
        public int FieldType {  private set; get; }

        private OperationSettingItem() { }

        public OperationSettingItem(Guid id , Guid operationSettingId , string fieldName, string fieldCaption , int fieldType)
        {
            Id = id;
            OperationSettingId = operationSettingId;
            FieldName = fieldName;
            FieldCaption = fieldCaption;
            FieldType = fieldType;
        }
    }
}
